﻿using System.Threading.Tasks;
using System.Web.Mvc;
using BestQA.Commands;
using BestQA.Web.Extensions;
using ECommon.Components;
using ECommon.Utilities;
using ENode.Commanding;
namespace BestQA.Web.Controllers
{
    public class HomeController : Controller
    {
        public async Task<ActionResult> Index()
        {
            //var commandService = ObjectContainer.Resolve<ICommandService>();
            //var result = commandService.ExecuteAsync(
            //    new CreateQuestionCmd() { AggregateRootId = ObjectId.GenerateNewStringId(), Title = "New Question" })
            //    .WaitResult(5000);  不能使用waitresult等待，BUG
            //var result = await commandService.ExecuteAsync(
            //    new CreateQuestionCmd() {AggregateRootId = ObjectId.GenerateNewStringId(), Title = "New Question"});
            //if (result.Data.Status == CommandStatus.Success)
            //{
            //}
            //else
            //{
            //}
            return View();
        }
    }
}
